package cn.cy.behavior.command.pattern;

/**
 * @author yangxq
 * @desc 接收者：灯光类
 * @Date 2025-05-08
 */
public class Light {

    private int brightness = 50;

    public void turnOn() {
        System.out.println("灯光已打开");
    }

    public void turnOff() {
        System.out.println("灯光已关闭");
    }

    public void increaseBrightness() {
        if (brightness < 100) {
            brightness++;
            System.out.println("灯光亮度增加到: " + brightness);
        } else {
            System.out.println("灯光亮度已达到最大值");
        }
    }

    public void decreaseBrightness() {
        if (brightness > 0) {
            brightness--;
            System.out.println("灯光亮度降低到: " + brightness);
        } else {
            System.out.println("灯光亮度已达到最小值");
        }
    }

}
